package com.purchase.manage.mapper;

import com.purchase.manage.damian.*;
import com.purchase.manage.damian.DAO.StoreQuotationListEXCELDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.Date;
import java.util.List;

@Mapper
public interface ManageFileMapper {
    //采购员创建商品类主订单
    int insertOrder(OrderList orderList);

    //采购员 创建 商品类物资清单
    int insertQuotationList(StoreQuotationList s1);

    //供应商创建从表
    int insertOrderBySupplier(StoreQuotation storeQuotation);

    //供应商 填写的商品类物资清单
    int insertQuotationListBySupplier(StoreQuotationList list);

    //采购员 创建 工程类物资清单
    int insertProjectQuotationList(OrderProjectList o1);

    int insertOrderBySupplierProject(OrderProject order);

    //查询是否存在重复询价单
    int selectCountOrder(@Param("orderd") Long orderId,@Param("userid") Long userId);

    int selectCountOrderProject(@Param("orderd")Long orderId,@Param("userid")  Long userId);

    //查看工程类订单详细物资
    List<OrderProjectList> selectReleaseMaterialsListProject(@Param("orderId")Long orderId);

    //查看商品类订单详细物资
    List<StoreQuotationList> selectReleaseMaterialsListOther(@Param("orderId") Long orderId);

    //商品比价
    List<StoreQuotationListEXCELDTO> priceComparison(@Param("name")String name);

    //查找符合条件的供应商
    List<Supplier> selectSu(@Param("ids")String ids);

    //添加供应商关系表
    void insertSys(SysSupplierState sys);

    //检查重复
    int checkSys(SysSupplierState sys);

    //改变状态
    void updateSys(@Param("orderId")Long orderId,@Param("supplier") Long supplier,@Param("state")String state);

    //查找供应商工程类 报价单
    OrderProject selectProject(@Param("orderId")Long orderId,@Param("supplierId")Long supplierId);

    //查找供应商商品类 报价单
    StoreQuotation selectStore(@Param("orderId")Long orderId,@Param("supplierId")Long supplierId);

    Long selectstid(@Param("orderid") Long orderId,@Param("supplierId")Long supplierId);

    List<StoreQuotationList> selectstoreList(@Param("stid")Long stid);

    Long selectPid(@Param("orderid") Long orderId,@Param("supplierId") Long supplierId);

    List<OrderProjectList> selectp(@Param("pid")Long pid);

    //获取 订单信息
    OrderList getOrder(@Param("orderId") Long orderId);

    int getCountOrder(@Param("orderId") Long orderId);

    int getCountOrderProject(@Param("orderId") Long orderId);
}
